#include "gtkbuildable.h"
#include "gtkprivate.h"
#include "gtkwidget.h"
+#include "gtksettings.h"
+#include "gtkdialogprivate.h"
struct _GtkFontChooserDialogPrivate
{
* <title>GtkFontChooserDialog as GtkBuildable</title>
* The GtkFontChooserDialog implementation of the GtkBuildable interface
* exposes the buttons with the names
- * "select_button" and "cancel_button.
+ * "select_button" and "cancel_button".
* </refsect2>
*
* Since: 3.2
"/org/gtk/libgtk/gtkfontchooserdialog.ui");
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserDialog, fontchooser);
- gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserDialog, select_button);
- gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserDialog, cancel_button);
gtk_widget_class_bind_template_callback (widget_class, font_activated_cb);
}
priv = fontchooserdiag->priv;
gtk_widget_init_template (GTK_WIDGET (fontchooserdiag));
+ gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (fontchooserdiag));
+ gtk_dialog_add_buttons (GTK_DIALOG (fontchooserdiag),
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Select"), GTK_RESPONSE_OK,
+ NULL);
+ gtk_dialog_set_default_response (GTK_DIALOG (fontchooserdiag), GTK_RESPONSE_OK);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_dialog_set_alternative_button_order (GTK_DIALOG (fontchooserdiag),
GTK_RESPONSE_OK,
-1);
G_GNUC_END_IGNORE_DEPRECATIONS
+ priv->select_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (fontchooserdiag), GTK_RESPONSE_OK);
+ priv->cancel_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (fontchooserdiag), GTK_RESPONSE_CANCEL);
+
_gtk_font_chooser_set_delegate (GTK_FONT_CHOOSER (fontchooserdiag),
GTK_FONT_CHOOSER (priv->fontchooser));
}
<template class="GtkFontChooserDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
- <property name="title" translatable="yes">Font Selection</property>
+ <property name="title" translatable="yes">Select Font</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="cancel_button">
- <property name="label" translatable="yes">_Cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="select_button">
- <property name="label" translatable="yes">_Select</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
<child>
<object class="GtkFontChooserWidget" id="fontchooser">
<property name="visible">True</property>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-6">cancel_button</action-widget>
- <action-widget response="-5">select_button</action-widget>
- </action-widgets>
</template>
</interface>